import request from '@/utils/request';
import qs from 'qs';
//查看所有题目   分页查询
export const GetAllTestList = ({page,number,type,search}) => request({
    url: `/tp/topic?page=${page}&number=${number}&type=${type}&search=${search}`,
    method: 'get',
})
// // 指定类型查询
// export const GetSomeTestList = ({ type, search }) => request({
//     url: `/tp/topic?type=${type}&search=${search}`,
//     method: 'get',
// })
export const GetTestList = () => request({
    url: '/tp/topic',
    method: 'get',
})
//添加题目
export  const AddTestList = ({topics,options,answer,effect}) => request({
  url:'/tp/topic',
  method:'post',
  data:{topics,options,answer,effect}
})
//修改题目
export const ReviseTestList = (data) => request({
    url: '/tp/topic',
    method: 'put',
    data
})
// 删除题目
export const DeleteTestList = (uuid) => request({
    url: '/tp/topic',
    method: 'delete',
    data: {uuid}
})
//获取题单
export const GetTestBar = () => request({
    url: 'tp/topic_list',
    method: 'get'
})

//创建题单
export const NewTestBar = ({name,list,topics,standard,scoring_criteria}) => request({
    url: '/tp/topic_list',
    method: 'post',
    data: {name,list,topics,standard,scoring_criteria}
})
//修改题单
export const ReviseTestBar = (data) => request({
    url: '/tp/topic_list',
    method: 'put',
    data
})
// 删除题单
export const DeleteTestBar = (uuid) => request({
    url: '/tp/topic_list',
    method: 'delete',
    data: {uuid}
})